Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / androidApp / src / test / kotlin / org / meshtastic / app / di / KoinVerificationTest.kt

Displaying Raw • Download

androidApp/src/test/kotlin/org/meshtastic/app/di/KoinVerificationTest.kt 2d20cd8a4708e2ef66e98d5259f3a97ec93f240a (2d20cd8a) Text, 3.56 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.di

Tff7b72import T7ee787android.app.Application
Tff7b72import T7ee787android.content.Context
Tff7b72import T7ee787androidx.lifecycle.Lifecycle
Tff7b72import T7ee787androidx.lifecycle.SavedStateHandle
Tff7b72import T7ee787androidx.work.WorkManager
Tff7b72import T7ee787androidx.work.WorkerParameters
Tff7b72import T7ee787io.ktor.client.HttpClient
Tff7b72import T7ee787io.ktor.client.engine.HttpClientEngine
Tff7b72import T7ee787kotlinx.coroutines.CoroutineDispatcher
Tff7b72import T7ee787org.koin.plugin.module.dsl.koinApplication
Tff7b72import T7ee787org.koin.test.verify.definition
Tff7b72import T7ee787org.koin.test.verify.injectedParameters
Tff7b72import T7ee787org.koin.test.verify.verify
Tff7b72import T7ee787org.meshtastic.app.map.MapViewModel
Tff7b72import T7ee787org.meshtastic.core.ble.BleLogFormat
Tff7b72import T7ee787org.meshtastic.core.ble.BleLogLevel
Tff7b72import T7ee787org.meshtastic.core.model.util.NodeIdLookup
Tff7b72import T7ee787org.meshtastic.feature.node.metrics.MetricsViewModel
Tff7b72import T7ee787kotlin.test.Test

Tff7b72class T56d364KoinVerificationTest Tb4b4b4{

Tf0883e@OptInTb4b4b4(Te6edf3orgTb4b4b4.Te6edf3koinTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3annotationTb4b4b4.Te6edf3KoinExperimentalAPITff7b72::Te6edf3classTb4b4b4)
Tf0883e@Test
Tff7b72fun Td2a8ffverifyKoinConfigurationTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3AppKoinModuleTb4b4b4(Tb4b4b4)
Tb4b4b4.Te6edf3moduleTb4b4b4(Tb4b4b4)
Tb4b4b4.Te6edf3verifyTb4b4b4(
Te6edf3extraTypes Tff7b72=
Te6edf3listOfTb4b4b4(
Te6edf3ApplicationTff7b72::Te6edf3classTb4b4b4,
Te6edf3ContextTff7b72::Te6edf3classTb4b4b4,
Te6edf3LifecycleTff7b72::Te6edf3classTb4b4b4,
Te6edf3SavedStateHandleTff7b72::Te6edf3classTb4b4b4,
Te6edf3WorkerParametersTff7b72::Te6edf3classTb4b4b4,
Te6edf3WorkManagerTff7b72::Te6edf3classTb4b4b4,
Te6edf3CoroutineDispatcherTff7b72::Te6edf3classTb4b4b4,
Te6edf3NodeIdLookupTff7b72::Te6edf3classTb4b4b4,
Te6edf3HttpClientTff7b72::Te6edf3classTb4b4b4,
Te6edf3HttpClientEngineTff7b72::Te6edf3classTb4b4b4,
T8b949e// BleLoggingConfig is a data class assembled by a factory function. Koin Verify
T8b949e// still introspects its constructor params, so the wrapping enums need to be
T8b949e// declared as known types even though they're never resolved from the graph.
Te6edf3BleLogLevelTff7b72::Te6edf3classTb4b4b4,
Te6edf3BleLogFormatTff7b72::Te6edf3classTb4b4b4,
Te6edf3okioTb4b4b4.Te6edf3PathTff7b72::Te6edf3classTb4b4b4,
Te6edf3okioTb4b4b4.Te6edf3FileSystemTff7b72::Te6edf3classTb4b4b4,
Tb4b4b4)Tb4b4b4,
Te6edf3injections Tff7b72=
Te6edf3injectedParametersTb4b4b4(
Te6edf3definitionTff7b72<Te6edf3MapViewModelTff7b72>Tb4b4b4(Te6edf3SavedStateHandleTff7b72::Te6edf3classTb4b4b4)Tb4b4b4,
Te6edf3definitionTff7b72<Te6edf3MetricsViewModelTff7b72>Tb4b4b4(Tffa657IntTff7b72::Te6edf3classTb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}

Tf0883e@Test
Tff7b72fun Td2a8ffverifyTypedBootstrapLoadsModuleGraphTb4b4b4(Tb4b4b4) Tb4b4b4{
T8b949e// koinApplication<T>() is a K2 compiler plugin stub. If the plugin fails to
T8b949e// transform it, the stub throws NotImplementedError at runtime. This test
T8b949e// validates that the production bootstrap path is correctly transformed by
T8b949e// successfully creating and closing the generated Koin application.
Tff7b72val Te6edf3app Tff7b72= Te6edf3koinApplicationTff7b72<Te6edf3AndroidKoinAppTff7b72>Tb4b4b4(Tb4b4b4)
Tff7b72try Tb4b4b4{
T8b949e// No-op: reaching this point proves the typed bootstrap path did not
T8b949e// throw and the generated application could be created.
Tb4b4b4} Tff7b72finally Tb4b4b4{
Te6edf3appTb4b4b4.Te6edf3closeTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.07s